package example.simple_mindmap.common.utils;

import java.util.regex.Pattern;

/**
 * @BelongsProject: 0.forum_system
 * @BelongsPackage: com.example.forum_system.utils
 * @Author : 游在海里的鱼
 * @CreateTime : 2023-11-06  16:36
 * @Version : 1.0
 * @Description : TODO
 */
public class DataUtil {
    public static boolean isNaturalNumInvalid(Byte num){
        return num == null || num < 0;
    }
    public static boolean isNaturalNumInvalid(Short num){
        return num == null || num < 0;
    }
    public static boolean isNaturalNumInvalid(Integer num){
        return num == null || num < 0;
    }
    public static boolean isNaturalNumInvalid(Long num){
        return num == null || num < 0;
    }
    public static boolean isNaturalNumInvalid(Float num){
        return num == null || num < 0 || (num%1) > 0;
    }
    public static boolean isNaturalNumInvalid(Double num){
        return num == null || num < 0 || (num%1) > 0;
    }
    public static boolean isWordInvalid(String str){
        return !Pattern.matches("[a-zA-Z]+", str);
    }

}
